package api

import (
	"go-weiqi-system/config"
	"go-weiqi-system/internal/models"
	"go-weiqi-system/internal/utils"

	"github.com/gin-gonic/gin"
)

type CourseLevelController struct{}

// Index 课程等级列表
func (ctrl *CourseLevelController) Index(c *gin.Context) {
	var levels []models.CourseLevel
	config.DB.Where("status = ?", 1).
		Order("sort desc, id desc").
		Find(&levels)

	utils.Success(c, levels)
}
